#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_bt_0_clicked()
{
    ui->result->setText(ui->result->text()+QString::number(0));
}

void MainWindow::on_bt_1_clicked()
{
    ui->result->setText(ui->result->text()+QString::number(1));
}

void MainWindow::on_bt_2_clicked()
{
    ui->result->setText(ui->result->text()+QString::number(2));
}

void MainWindow::on_bt_3_clicked()
{
    ui->result->setText(ui->result->text()+QString::number(3));
}

void MainWindow::on_bt_4_clicked()
{
    ui->result->setText(ui->result->text()+QString::number(4));
}

void MainWindow::on_bt_5_clicked()
{
    ui->result->setText(ui->result->text()+QString::number(5));
}

void MainWindow::on_bt_6_clicked()
{
    ui->result->setText(ui->result->text()+QString::number(6));
}

void MainWindow::on_bt_7_clicked()
{
    ui->result->setText(ui->result->text()+QString::number(7));
}

void MainWindow::on_bt_8_clicked()
{
    ui->result->setText(ui->result->text()+QString::number(8));
}

void MainWindow::on_bt_9_clicked()
{
    ui->result->setText(ui->result->text()+QString::number(9));
}

void MainWindow::on_bt_dot_clicked()
{
    ui->result->setText(ui->result->text()+".");
}

void MainWindow::on_bt_plus_clicked()
{
    ui->result->setText(ui->result->text()+"＋");
}

void MainWindow::on_sub_clicked()
{
    ui->result->setText(ui->result->text()+"－");
}

void MainWindow::on_bt_mult_clicked()
{
    ui->result->setText(ui->result->text()+"×");
}

void MainWindow::on_bt_divi_clicked()
{
    ui->result->setText(ui->result->text()+"÷");
}

void MainWindow::on_bt_ce_clicked()
{
    ui->result->setText("");
}

void MainWindow::on_bt_back_clicked()
{
    ui->result->setText(ui->result->text().left(ui->result->text().size()-1));
}

void MainWindow::on_bt_off_clicked()
{
    ui->result->setText("");
}

void MainWindow::on_bt_mod_clicked()
{
    ui->result->setText(ui->result->text()+"%");
}

void MainWindow::on_bt_equal_clicked()
{
    ui->result->setText(ui->result->text()+"=");
}
